Home:ALL Converter>Can't connect to mysql server on windows 10

Can't connect to mysql server on windows 10

Ask Time:2018-09-11T15:34:18         Author:Suhas Bhattu

Json Formatter

I am trying to connect the MySQL server (mysql-5.7.23) from command prompt using the command mysql -u root it throws an error ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061). I am using Windows 10.

I have followed following steps :

  1. Unzip the mysql-5.7.23 file and put on C drive.
  2. Add the data folder in the installation directory and also add the my.ini
  3. Went to the bin folder in command prompt and executed mysqld --initialize-insecure, it generated some file in the data folder.
  4. Then I added the mysql path environment variable.
  5. After that I started MySQL service. It is running properly.
  6. Again in the command prompt, I have executedmysqld --install, it shows service already exists.
  7. But when I tried to connect to the server, it throws an error, ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

I have tried all solutions from ERROR 2003 (HY000): Can't connect to MySQL server on localhost (10061) , but still it is not working.

Am I missing something?

Edit : One more observation, when I execute mysqld, the cursor in the command prompt return to again current directory, which I think is not expected behavior.

Author:Suhas Bhattu,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/52270900/cant-connect-to-mysql-server-on-windows-10
yy